{include file="public/public"}
<style type="text/css">
    #show tr td{
        overflow: hidden;
    }
    #show tr td p {
        width: 150px;
        float: left;
        text-align: center;
    }

</style>
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;"></fieldset>
                <span class="layui-breadcrumb">
                    <a href="__APP__/{$menuConfigArry['functionMod']}/{$menuConfigArry['menuLabel']}">{$menuConfigArry['pmenuName']}</a>
                    <a><cite>{$menuConfigArry['menuName']}</cite></a>
                </span>
                <hr>
                <div class="layui-form-item" style="margin-top: 20px;">
                    <div class="layui-inline">
                        <label class="layui-form-label">按酒店名</label>
                        <div class="layui-input-inline">
                            <input id='souname' name="text2" type="text" class="layui-input" />
                        </div>
                        <a href="#" onClick="subsou()" class="layui-btn ">搜索</a>
                    </div>
                    <div class="layui-inline">
                        <a href="__APP__/admin/operationlog?type=hotel">操作日志</a>
                    </div>
                </div>
                <table class="layui-table" lay-skin="line">
                    <thead>
                    <tr>
                        <td width="75">选择</td>
                        <td width="85">编号</td>
                        <td width="267">酒店名</td>
                        <td width="261">酒店程序名</td>
                        <td width="261">酒店运营状态</td>
                        <td width="180">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <?
	                    if($roomArr){
	                      	foreach($roomArr as $val){
	                        $tmp = addslashes(json_encode($val));
	                     ?>
                    <tr>
                        <td><input type="checkbox" name="roombox" id="roombox" value="{$val[id]}"></td>
                        <td>{$val[id]}</td>
                        <td>{$val[hotel]}</td>
                        <td>{$val[hotelName]}</td>
                        <td>{$val[operationStatus]}</td>
                        <td>
                            <a href="#" class="layui-btn layui-btn-sm" onclick='edit("{$tmp}",2)'>修改 </a>
                        </td>
                    </tr>
                    <?php
                        }
                    }
                ?>
                    </tbody>
                </table>

                <div>管理操作全选
                    <input type="checkbox" onClick="checkallstu(this)" />
                    <input name="submit" type="submit" value="删除" onclick="delall()" class="layui-btn layui-btn-sm layui-btn-warm" />
                    <input name="submit2" type="button" value="添加酒店" onclick="document.getElementById('show').style.display='block'" class="layui-btn layui-btn-sm" />
                </div>
                <div class="layui-box layui-laypage layui-laypage-default">{$page}</div>

                <FORM action="__APP__/admin/addhotel" enctype="multipart/form-data" method="post">
                    <div id="show" style="display:none" class="show">
                        <table class="layui-table">
                            <colgroup>
                                <col width="400">
                                <col width="400">
                            </colgroup>
                            <thead>
                            <tr>
                                <td colspan="2">酒店信息</td>
                                <input type="hidden" id="id" name="id">
                            </tr>
                            </thead>
                            <tbody>

                            <tr class="ctt_gr">
                                <td align="left" class="leftClass">
                                    <p>所属品牌：</p>
                                    <input class="textField_hp1" name="hotel_brand" lay-verify="title" autocomplete="off" class="" id="hotel_brand">
                                </td>
                                <td align="left">
                                    <p>试用开始时间：</p>
                                    <input class="textField_hp1" size="20" id="hotel_try_start" name="hotel_try_start" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>酒店状态：</p>
                                    <select id="hotel_use_state" name="hotel_use_state">
                                        <option value="0">意向合作</option>
                                        <option value="1">待审核</option>
                                        <option value="2">已审核</option>
                                        <option value="3">待工勘</option>
                                        <option value="4">已工勘</option>
                                        <option value="5">待实施</option>
                                        <option value="6">试用中</option>
                                        <option value="7">使用中</option>
                                        <option value="8">已停用</option>
                                        <option value="9">已暂停</option>
                                        <option value="10">已取消</option>
                                    </select>
                                </td>
                                <td align="left">
                                    <p>试用结束时间：</p>
                                    <input class="textField_hp1" size="20" id="hotel_try_end" name="hotel_try_end" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left" class="leftClass">
                                    <p>酒店中文名称：</p>
                                    <input class="textField_hp1" name="hotel" lay-verify="title" autocomplete="off" class="" id="hotel">
                                </td>
                                <td align="left">
                                    <p>合同开始时间：</p>
                                    <input class="textField_hp1" size="20" id="contractStartTime" name="contractStartTime" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>酒店英文名称：</p>
                                    <input class="textField_hp1" size="20" id="english_name" name="english_name" />
                                </td>
                                <td align="left">
                                    <p>合同结束时间：</p>
                                    <input class="textField_hp1" size="20" id="contractEndTime" name="contractEndTime" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>酒店程序名称：</p>
                                    <input class="textField_hp1" size="20" id="hotelName2" name="hotelName" />
                                </td>
                                <td align="left">
                                    <p>合同编号：</p>
                                    <input class="textField_hp1" size="20" id="contractNo" name="contractNo" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>详细中文地址：</p>
                                    <input class="textField_hp1" size="20" id="addrDetial" name="addrDetial" />
                                </td>
                                <td align="left">
                                    <p>酒店管理公司：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_manage_company" name="hotel_info_manage_company" />
                                </td>

                            </tr>
                            <tr class="ctt_gr">
                                <td>
                                    <p>详细英文地址：</p>
                                    <input class="textField_hp1" size="20" id="hotel_english_location" name="hotel_english_location" />
                                </td>
                                <td align="left">
                                    <p>酒管地址：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_manage_location" name="hotel_info_manage_location" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>前台总机：</p>
                                    <input class="textField_hp1" size="20" id="hotel_phone" name="hotel_phone" />
                                </td>
                                <td align="left">
                                    <p>酒管联系人：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_manage_linkman" name="hotel_info_manage_linkman" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>客房数量：</p>
                                    <input class="textField_hp1" size="20" id="hotel_room" name="hotel_room" />
                                </td>
                                <td>
                                    <p>酒管联系人电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_manage_linkman_phone" name="hotel_info_manage_linkman_phone" />
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <p>投影数量：</p>
                                    <input class="textField_hp1" size="20" id="XScount" name="XScount" />
                                </td>
                                <td align="left">
                                    <p>酒管总经理：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_manage_boss" name="hotel_info_manage_boss" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>盒子数量：</p>
                                    <input class="textField_hp1" size="20" id="PCcount" name="PCcount" />
                                </td>
                                <td align="left">
                                    <p>酒管总经理电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_manage_boss_phone" name="hotel_info_manage_boss_phone" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>电视数量：</p>
                                    <input class="textField_hp1" size="20" id="TVcount" name="TVcount" />
                                </td>
                                <td align="left">
                                    <p>酒店总经理：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_boss" name="hotel_info_hotel_boss" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>添加时间：</p>
                                    <input class="textField_hp1" size="20" id="addtime" name="addtime" readonly value="不可更改项"/>
                                </td>
                                <td align="left">
                                    <p>酒店总经理电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_boss_phone" name="hotel_info_hotel_boss_phone" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>酒店星级：</p>
                                    <select id="starlevel" name="starlevel">
                                        <option value="7">☆☆☆☆☆☆☆</option>
                                        <option value="6">☆☆☆☆☆☆</option>
                                        <option value="5">☆☆☆☆☆</option>
                                        <option value="4">☆☆☆☆</option>
                                        <option value="3">☆☆☆</option>
                                        <option value="2">☆☆</option>
                                        <option value="1">☆</option>
                                    </select>
                                </td>
                                <td align="left">
                                    <p>酒店营销总监：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_sell_boss" name="hotel_info_hotel_sell_boss" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>所属集团：</p>
                                    <select id="hotelGroup" name="hotelGroup">
                                        <option value="0">无所属</option>
                                        <?php
                            if($hotelGroup){ foreach($hotelGroup as $varhotelGroup){
                         ?>

                                        <option value="{$varhotelGroup['id']}">{$varhotelGroup['groupname']}</option>
                                        <?php
                            }
                            }
                            ?>

                                    </select>
                                </td>
                                <td align="left">
                                    <p>酒店营销总监电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_sell_boss_phone" name="hotel_info_hotel_sell_boss_phone" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>运营状态：</p>
                                    <select id="operationStatus" name="operationStatus">
                                        <option value="test" selected="selected">测试</option>
                                        <option value="trial">试运营</option>
                                        <option value="formal">正式运营</option>
                                    </select>
                                </td>
                                <td align="left">
                                    <p>酒店工程部联系人：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_engineer_boss" name="hotel_info_hotel_engineer_boss" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>酒店标签：</p>
                                    <input class="" type="checkbox" checked size="20" id="hotel_Label_1" name="hotel_Label" />1
                                    <input class="" style="margin-left: 5px;" type="checkbox" checked size="20" id="hotel_Label_2" name="hotel_Label" />2
                                    <input class="" style="margin-left: 5px;" type="checkbox" checked size="20" id="hotel_Label_3" name="hotel_Label" />3
                                </td>
                                <td align="left">
                                    <p>酒店工程部电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_engineer_boss_phone" name="hotel_info_hotel_engineer_boss_phone" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>郊区与否：</p>
                                    <input class="" type="radio" checked size="20" id="hotel_suburb_1" name="hotel_suburb" value="1"/>是
                                    <input class="" type="radio" style="margin-left: 10px;" size="20" id="hotel_suburb_2" name="hotel_suburb" value="0" />否
                                </td>
                                <td align="left">
                                    <p>酒店合同负责人：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_contracter" name="hotel_info_hotel_contracter" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>风霆迅服务器Key：</p>
                                    <input class="textField_hp1" size="20" id="hotel_key" name="hotel_key" />
                                </td>
                                <td align="left">
                                    <p>酒店合同负责人电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_contracter_phone" name="hotel_info_hotel_contracter_phone" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>风霆迅vpnIP地址：</p>
                                    <input class="textField_hp1" size="20" id="hotel_server_ip" name="hotel_server_ip" />
                                </td>
                                <td align="left">
                                    <p>渠道商负责人：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_clientele" name="hotel_info_hotel_clientele" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>tlk服务器Key：</p>
                                    <input class="textField_hp1" size="20" id="hotel_server_key" name="hotel_server_key" />
                                </td>

                                <td align="left">
                                    <p>渠道商负责人电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_clientele_phone" name="hotel_info_hotel_clientele_phone" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>酒店vpnIP：</p>
                                    <input class="textField_hp1" size="20" id="hotelIP" name="hotelIP" />
                                </td>
                                <td align="left">
                                    <p>酒店发展顾问：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_develop" name="hotel_info_hotel_develop" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>备注：</p>
                                    <input class="textField_hp1" size="20" id="Remarks" name="Remarks" />
                                </td>
                                <td align="left">
                                    <p>酒店发展顾问电话：</p>
                                    <input class="textField_hp1" size="20" id="hotel_info_hotel_develop_phone" name="hotel_info_hotel_develop_phone" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td colspan='2' align="left">
                                    <p>所属地区：</p>
                                    <span>省：
											<select id="p" name="p">
		                        			<? if($list1){ foreach($list1 as $list){ ?>
                                                <option value="{$list['assign']}" >{$list['cityName']}</option>
                                                <? }} ?>
                    						</select>
                        				</span>
                                    <span>市：
											<select id="c" name="c">
                        					<? if($list2){ foreach($list2 as $list){ ?>
                                                <option value="{$list['assign']}">{$list['cityName']}</option>
                                                <? }} ?>
                    						</select>
                   						</span>
                                    <span>县：
											<select id="x" name="x">
                        					<? if($list3){ foreach($list3 as $list){ ?>
                                                <option value="{$list['assign']}" >{$list['cityName']}</option>
                                                <? }} ?>
                    						</select>
                   						 </span>
                                </td>
                            </tr>
                            <tr>
                                <td colspan='2' align="left">
                                    <div id="r-result" style='text-align:left;'>
                                        <p>地址关键字：</p>
                                        <input type="text" id="suggestId" size="20" style="width:150px;" />
                                        <input type='text' id='locNumLat' size="6" name='locNumLat' />
                                        <input type='text' id='locNumLng' name='locNumLng' size="6" />
                                    </div>
                                    <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:120px;height:auto; display:none;"></div>
                                    <div id="allmap"></div>
                                    <input type='hidden' id='realaddr' name='realaddr' />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td height="31" colspan="2" align="center">
                                    <input name="submit22" type="submit" value="确定" border="0" class="layui-btn" id="ok" />
                                    <input name="submit22" type="button" value="取消" border="0" onclick="document.getElementById('show').style.display='none'" class="layui-btn layui-btn-warm" />
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </FORM>
            </div>
        </div>
    </div>
</div>
<style type="text/css">
    #allmap {
        height: 300px;
        width: 90%;
        margin: 0px auto;
        overflow: hidden;
        font-family: "微软雅黑";
    }
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZFrrzgw9CzThkNn5p1KkfmUe59MtYivE"></script>

<script language="javascript">
    function checkallstu(o) {
        if(o.checked) {
            $("input[name='roombox']").attr("checked", true);
        } else {
            $("input[name='roombox']").attr("checked", false);
        }
    }

    function delall() {
        var arr = "";
        $("input[name=roombox]:checked").each(function() {
            arr += $(this).val() + ",";
        })
        if(arr == "") {
            alert('请选择要删除的记录');
            return false;
        }
        if(confirm("您确定要删除吗？")) {
            $.post("__APP__/admin/delallhotel", {
                arr: arr
            }, function(data) {
                if(data.msg == "1") {
                    alert("删除成功");
                    location.reload();
                } else {
                    alert("删除失败");
                }
            }, "json");
        } else {
            return false;
        }
    }

    function edit(val, flag) {

//        console.log(flag,JSON.parse(val));
        var json = JSON.parse(val);
        if(json.address) {
            setPlace(json.address);
        } else {
            setPlace('北京市');
        }

        $("#id").val(json.id);
        $("#hotel").val(json.hotel);
        $("#english_name").val(json.english_name);
        $("#hotelName2").val(json.hotelName);
        $("#address").val(json.address);
        $("#hotel_english_location").val(json.hotel_english_location);

        $("#hotel_room").val(json.hotel_room);
        $("#XScount").val(json.clientNo);
        $("#PCcount").val(json.clientNoPc);
        $("#TVcount").val(json.clientNoTv);
        $("#starlevel").val(json.starlevel);
        $("#hotelGroup").val(json.groupId);
        $("#operationStatus").val(json.operationStatus);
//        $("#hotel_suburb").val(json.hotel_suburb);
        $("#hotel_brand").val(json.hotel_brand);
        $("#hotel_server_key").val(json.hotel_server_key);
        $("#hotel_server_ip").val(json.hotel_server_ip);
        $("#hotel_key").val(json.hotel_key);
        $("#hotelIP").val(json.ipaddr);
        $("#Remarks").val(json.demand);
        $("#addtime").val(json.addtime);

        $.post("__APP__/admin/getHotelInfo", {
            id: json.id
        }, function(data) {
            var json = JSON.parse(data);
           for(var key in json){
               $("#"+key).val(json[key]);
           }
        });


        $('#locNumLat').val(json.lat / 100000000);
        $('#locNumLng').val(json.lng / 100000000);
        $('#suggestId').val('');

        var citycode = json.citycode;

        var cityName1 = citycode.substr(0, 2);
        var cityName2 = citycode.substr(0, 4);
        var cityName3 = citycode;
        $("#p").val(cityName1);
        $.post("__APP__/admin/getcity2", {
            code: cityName1
        }, function(data) {
            $("#c").html(data);
            $("#c").val(cityName2);
            $.post("__APP__/admin/getcity2", {
                code: cityName2
            }, function(data) {
                $("#x").html(data);
                $("#x").val(cityName3);
            });
        });

        $("#show").show();
    }

    function subsou() {
        var souname = $("#souname").val();
        window.location.href = '__APP__/admin/hotelName?name=' + souname;
    }
</script>

<script>
    $('select[name=\'p\']').bind('change', function() {
        var code = $('select[name=\'p\']').val();
        var pname = $('#p option:selected').html() + ' ';
        $.post("__APP__/admin/getcity2", {
            code: code
        }, function(data) {
            $("#c").html(data);
            var code1 = $('select[name=\'c\']').val();
            $.post("__APP__/admin/getcity2", {
                code: code1
            }, function(data) {
                setPlace(pname);
                $("#x").html(data);
            });
        });
    });
    $('select[name=\'c\']').bind('change', function() {
        var code = $('select[name=\'c\']').val();
        var pname = $('#p option:selected').html() + ' ';
        var cname = pname + $('#c option:selected').html() + ' ';
        $.post("__APP__/admin/getcity2", {
            code: code
        }, function(data) {
            setPlace(cname);
            $("#x").html(data);
        });
    });
    $("#x").bind('change', function() {
        var xname = $('#p option:selected').html() + ' ' + $('#c option:selected').html() + ' ' + $('#x option:selected').html();
        setPlace(xname);
    });
    // 百度地图API功能
    function G(id) {
        return document.getElementById(id);
    }

    var map = new BMap.Map("allmap");
    map.centerAndZoom('北京', 12); // 初始化地图,设置城市和地图级别。
    map.enableScrollWheelZoom(true);
    map.setDefaultCursor("url('bird.cur')");
    var ac = new BMap.Autocomplete( //建立一个自动完成的对象
        {
            "input": "suggestId",
            "location": map
        });

    ac.addEventListener("onhighlight", function(e) { //鼠标放在下拉列表上的事件
        var str = "";
        var _value = e.fromitem.value;
        var value = "";
        if(e.fromitem.index > -1) {
            value = _value.province + _value.city + _value.district + _value.street + _value.business;
        }
        str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;

        value = "";
        if(e.toitem.index > -1) {
            _value = e.toitem.value;
            value = _value.province + _value.city + _value.district + _value.street + _value.business;
        }
        str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
        G("searchResultPanel").innerHTML = str;
    });

    var myValue;
    ac.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件
        var _value = e.item.value;
        myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
        G("searchResultPanel").innerHTML = "onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;
        setPlace(myValue);
    });

    function showInfo(e) {
        map.clearOverlays();
        var zoomsize = map.getZoom();
        if(confirm('确认讲酒店定位此处？')) {
            $('#locNumLng').val(e.point.lng);
            $('#locNumLat').val(e.point.lat);
            map.addOverlay(new BMap.Marker(e.point));
        }
        //alert(e.point.lng + ", " + e.point.lat);
    }

    map.addEventListener("click", showInfo);

    function setPlace(loc) {
        map.clearOverlays(); //清除地图上所有覆盖物
        function myFun() {
            var pp = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
            map.centerAndZoom(pp, 16);
            map.addOverlay(new BMap.Marker(pp)); //添加标注
        }
        var local = new BMap.LocalSearch(map, { //智能搜索
            onSearchComplete: myFun
        });
        local.search(loc);
        var myGeo = new BMap.Geocoder();
        myGeo.getPoint(loc, function(point) {
            var geoc = new BMap.Geocoder();
            geoc.getLocation(point, function(rs) {
                var addComp = rs.addressComponents;
                var realaddr = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
                $('#realaddr').val(realaddr);
                changeOld(addComp.province, addComp.city, addComp.district);
            });
            $('#locNumLng').val(point.lng);
            $('#locNumLat').val(point.lat);
        }, '北京市');
    }

    function changeOld(pro, city, xian) {
        $('#p option').each(function() {
            if(pro.indexOf($(this).html()) >= 0) {
                var optpv = $(this).val();
                $("#p option[value='" + optpv + "']").attr('selected', true);
                $.post("__APP__/admin/getcity2", {
                    code: optpv
                }, function(data) {
                    $("#c").html(data);
                    $('#c option').each(function() {
                        if(city.indexOf($(this).html()) >= 0) {
                            var optcv = $(this).val();
                            $("#c option[value='" + optcv + "']").attr('selected', true);
                            $.post("__APP__/admin/getcity2", {
                                code: optcv
                            }, function(data) {
                                $("#x").html(data);
                                $('#x option').each(function() {
                                    if(xian.indexOf($(this).html()) >= 0) {
                                        console.log($(this).html());
                                        var optxv = $(this).val();
                                        $("#x option[value='" + optxv + "']").attr('selected', true);
                                    }
                                });
                            });
                        }
                    });
                });
            }
        });
    }
</script>
<script type="text/javascript">
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#hotel_try_start',
            type: 'datetime' //试用开始时间
        });
        laydate.render({
            elem: '#hotel_try_end',
            type: 'datetime' //试用结束时间
        });
        laydate.render({
            elem: '#contractStartTime',
            type: 'datetime' //合同开始时间
        });
        laydate.render({
            elem: '#contractEndTime',
            type: 'datetime' //合同结束时间
        });

    });
</script>